/*
 * Copyright (C) 2009 Chang Min Lee <ch5ngmn@gmail.com>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details. (/COPYING)
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
#ifndef TAONET_COMM_BROKER_CONFIGURATION_H
#define TAONET_COMM_BROKER_CONFIGURATION_H

#include "ace/ARGV.h"
#include "ace/SString.h"

class CommBrokerConfiguration
{
public:
	CommBrokerConfiguration ();

	//CollocationStrategy
	enum CollocationStrategy{
		ThruPoa,
		Direct
	};

	//CollocationType
	enum CollocationType{
		Global,
		Per_ORB,
		No,
	};

	////////////
	// Debugging
	void enableDebug();
	
	void setDebugLevel (ACE_UINT32 level);

	void setLogFile (const ACE_TCHAR *file);

	////////////////////
	// Request Processing
	void setCollocationType (CollocationType type);

	void setCollocatoinStrategy (CollocationStrategy strategy);

	void setNoDelay (bool delay);

	void setSendSock (size_t size);

	void setRecvSock (size_t size);

	void singleReadOptimization (bool enabled);

	////////////////////////
	// Connection Management
	void setLingerTimeout (int timeout);

	void setListenEndpoint (const ACE_TCHAR *hostname, ACE_UINT16 port, ACE_UINT16 portspan);

	void nameService (const ACE_TCHAR *file);
	void nameService (const ACE_TCHAR *ip, ACE_UINT16 port);
	void dump ();

	int argc() { return args_.argc(); }
	ACE_TCHAR ** argv() { return args_.argv(); }

private:

	ACE_TCHAR  logFile_[64];
	ACE_TCHAR  debugLevel_[64];
	ACE_TCHAR  sendSock_[64];
	ACE_TCHAR  recvSock_[64];
	ACE_TCHAR  lingerTimeout_[64];
	ACE_TCHAR  listenEndpoint_[128];
	ACE_TCHAR  nameService_[128];


	ACE_ARGV args_;
};
#endif